home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 3
/
Gold Medal Software - Volume 3 (Gold Medal) (1994).iso
/
utils2
/
sw_46.arj
/
DI-14.DOC
next >
Wrap
Text File
|
1992-12-20
|
10KB
|
233 lines
┌────────────────────────────┐
│ │░░
│ DI.EXE │░░
│ Disk Information │░░
│ │░░
│ ▄▀▀▀▀▄ │░░
│ █ █ │░░
│ ▀▀▀▀ │░░
│ ┌──┐ │░░
│ Ver 1.4 │ │ (c) 1992 │░░
│ │ │ │░░
│ └──┘ │░░
└────────────────────────────┘░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
December 20, 1992
INTRODUCTION
The SW package contains the companion program, DI.EXE. This little
utility will be indispensable for those batch files that require the informa-
tion about a disk or drive. If you've ever had your nice SW screen messed up
with DOS error messages, you'll love DI!
The program puts all the little disk checking functions in one easy to
use package. With it you can check the validity of a drive letter input from
the user, drive status, disk status, and identify the current drive. You can
even access the Volume label on a disk to verify that the user has put the
proper disk in the drive. Volume labels can be changed too. You can even make
sure there's enough space for copying files or check the PATH for a file.
SYNTAX: DI [drive:] /switch [label | filespec | size | varname] [/CD]
The first parameter indicates the drive on which the operation is to
take place. If it is left out, the default drive will be used. These are the
switches:
/VALID - Check drive to verify its existence.
/READY - Check drive to see if a disk is present.
/WRITE - Check disk write-protect status.
/ID - Return current drive #. A=1, B=2, etc.
/SPACE - Check disk for available space.
/SIZE - Check disk size. Returns EL code.
/TYPE - Check device type. Returns EL code.
/EXIST - Check PATH for a file. /CD to change to location.
/FIND - Locate file on drive. /CD to change to location.
/MATCH_VOL - Check for proper Volume ID.
/NEW_VOL - Change Volume ID.
/DEL_VOL - Delete Volume ID.
/GET_VOL - Get Volume ID. Returned to environment.
The third parameter is used with the /SPACE, /EXIST, /FIND, /ID and
Volume ID switches.
/VALID /READY /WRITE
These switches check the state of the drive. /VALID merely verifies the
existance of the device. /READY determines if a formatted disk is
present. /WRITE checks the write protection status. All of these return
an EL 0 (Errorlevel 0) if true and an EL 1 if not. Additionally, they
will return an EL 2 if a bad or unformatted disk is present.
/ID
This switch identifies the current drive. The Errorlevel returned
corresponds to the drive number where A=1, B=2, etc. You can then set an
environment variable to be used to return to that drive at any point in
your batch file. If you use DOS 3.3 or higher, DI /ID can save you the
trouble by returning the drive letter directly into the environment.
Just add the variable name (8 letters max) you want the letter assigned
to after the switch. Only the letter is returned so be sure to use a
colon after it in the batch file (e.g. %DRV%:).
1
/SPACE
Two methods can be used to check available space. You can either provide
a filespec such as "c:\temp\*.exe" or the number of KBytes in the form
"/1024". If a filespec is provided, DI will count the number a bytes in
the files matching it, calculate the clusters that will be used by each
file, and then check the drive for available space. NOTE: If providing
only a path without a filename, end it with a \. c:\temp\ is the same as
c:\temp\*.*. Without the \, DI will check c:\ for a file named temp.
/SPACE will work on drives up to 4,000 MB capacity. Returns EL 0 when
there enough space. CAUTION: DI does not take into account files with
the same name on the destination drive.
/SIZE
This allows you to verify that the proper formatted floppy is in a
drive. This switch returns an EL code based on standard floppy disk
formats. EL 1 - No disk, EL 2 - bad or unformatted disk, EL 3 less than
180 K, EL 5 - 180K, EL 6 - 360K, EL 7 - 720K, EL 8 - 1.2M, EL 9 - 1.44M,
EL 10 - 2.88M, EL 11 greater than 2.88M. With this information you could
then issue the proper FORMAT command. Obviously, this switch cannot tell
you the size of a disk that has not been formatted and it will not tell
you how much space is actually available. Use /SPACE for that.
/TYPE
This switch will return an EL code based on the device type. The values
returned are similar to the /SIZE codes. EL 1 - Error accessing device,
EL 3 - Unknown device, EL 6 - 360K, EL 7 - 720K, EL 8 - 1.2M, EL 9 -
1.44M, EL 10 - 2.88M, EL 11 - Hard Disk, EL 12 - Tape Drive, EL 13 -
Optical Drive. The information obtained represents the default media for
the device and does not represent what may currently be in the device.
/EXIST
This expands the batch file function "if exist". This function will
search the PATH for the filename specified in the third parameter. This
will be useful if your batch file needs to know the capabilities of a
unfamiliar machine. The drive parameter is not used. Users of DOS 3.3 or
better have an additional feature. Add a variable name (8 letters max)
after the filename and DI will return the exact location of the file in
the DOS environment in the form d:\dir. If you want the drive and
directory information separate, specify two variables separated by a \.
e.g. "DI /EXIST XCOPY.EXE d\dir" will return "D=C" and "DIR=\DOS" in the
environment. Returns EL 0 if successful.
/FIND
This switch will locate the FIRST occurrence of a file on the specified
drive. The environment variable options described for /EXIST apply to
/FIND as well. Both /FIND and /EXIST also have the additional option of
changing to the drive and directory where the file was found. Add /CD
after the filename to make the change.
/MATCH_VOL /NEW_VOL /DEL_VOL /GET_VOL
For the Volume ID functions /MATCH_VOL and /NEW_VOL, the third parameter
is the label to match or the new label respectively. No label name is
required for /DEL_VOL or /GET_VOL. You can provide a variable name for
/GET_VOL to use as the third parameter. Although label checking is not
case-sensitive, labels written to the drive will be all caps. /GET_VOL
2
will return the answer in the environment using the drive letter as the
variable if no other variable name is provided. Returns EL 0 if
successful.
Most of these DI functions return EL 0 if the operation was successful,
EL 1 if not and EL 2 if the disk in the drive is unformatted or bad. While
debugging your batch files, you can add a /D as a last parameter to display
the code returned. Otherwise, there is no screen output from this utility
except when it receives a bad parameter or none at all. A short description
of the program and the switches is displayed in that case. If you pass a bad
parameter, DI will return Errorlevel 255.
DI switches can be shortened to 3 characters if you prefer. /EXIST can
be /EXI, /SPACE can be /SPA, etc. The longer forms just make the batch file
more readable. They can also be in upper, lower or mixed case.
NOTE: Any DI switch that uses the environment to return information
requires that you use DOS 3.3 or higher.
═══════════════════════════════════════════════════════════════════════════
DI.EXE is part of the SW shareware package. Registration information can
be found at the end of the SW.EXE documentation.
DI Ver. 1.4 December 20, 1992
Warren Small CIS 71076,407
35 Benjamin Street GEnie W.SMALL
Manchester, NH 03109 Prodigy RSJW31A
DI.EXE History
1.0 - 12/1/91 Initial Release.
1.1 - 2/2/92 New /ID switch for DI.EXE to return current drive. DOS
environment can be used with /ID and /EXIST to return info. DI switches
/READY and /WRITE enhanced to show bad or unformatted disks.
1.2 - 2/29/92 Added /FIND switch to locate first occurrence of a file.
/EXIST switch enhanced with /CD switch to change to the drive and directory
where the file was found. /FIND also has /CD option.
1.2a - 3/2/92 Fixed bug in /EXIST and /FIND which caused improper
operation if file was located in the root directory and /CD was specified.
1.3 - 6/30/92 /EXIST and /FIND enhanced to return drive and directory
in separate variables. Added /SIZE to get diskette size, /GET_VOL to read
volume label and return in environment.
1.4 - 12/20/92 /TYPE returns device type as EL.
3